#ifndef __PULL_STREAM_H
#define __PULL_STREAM_H
#include <string>
#include "stream/rtc_stream.h"
namespace xrtc
{

    class PullStream : public RtcStream
    {
    public:
        PullStream(EventLoop *el, PortAllocator *alloctor, uint64_t uid, const std::string &stream_name,
                   bool audio, bool video, uint32_t log_id);
        ~PullStream() override;
        std::string CreateOffer() override;
        RtcStreamType StreamType() { return RtcStreamType::kPull; }
        void AddAudioSource(std::vector<StreamParams> &source);
        void AddVideoSource(std::vector<StreamParams> &source);
        int SendPacket(webrtc::MediaType media_type, std::shared_ptr<RtcPacket> packet, bool is_retransmit = false);
        // int SendPacket(webrtc::MediaType media_type, const uint8_t *buf, size_t len);
        void SetSrInfo(webrtc::MediaType media_type, uint32_t rtp_timestamp, webrtc::NtpTime ntp);

    private:
        void OnNackReceived(PeerConnection *, webrtc::MediaType media_type, const std::vector<uint16_t> &nack_list);
    };

} // namespace xrtc

#endif